#include "../begonia.h"
#include "../bullet/bustbullet.h"
#include "boss_2_3.h"
#include "../base/scene.h"

boss_2_3::boss_2_3():boss(192.0,250.0,20.0,0.0,0.0,&f.head)
    {
    }
boss_2_3::boss_2_3(double tx,double ty,double tr,double tvx,double tvy,bullet *h):boss(tx,ty,tr,tvx,tvy,h)
    {
    }
    void boss_2_3::clone(bullet *h)
    {
        new boss_2_3(x,y,r,vx,vy,h);
    }
    bool boss_2_3::move()
    {
        if((int)t/4>(int)tlast/4)
        {
            new bustbullet(x+cos((int)t/4/2.5)*30.0,y+sin((int)t/4/2.5)*30.0,30.0,cos((int)t/4/2.5)*2.0,sin((int)t/4/2.5)*2.0,&f.head);
        }
        if((int)t>(int)tlast) if(rand()%4000<1000-cos(t/100.0)*1000)
        {
            double theta;
            theta=atan2(f.py-y,f.px-x)+double(rand()%101-50)/100.0*M_PI;
            new bullet(x,y,7.0,cos(theta)*3.0,sin(theta)*3.0,&f.head);
        }
        return true;
    }
